#define SIRIDB_MAX_SIZE_ERR_MSG 1024
#define SIRIDB_MAX_DBNAME_LEN 256 // 255 + NULL
-#define SIRIDB_SCHEMA 2
+#define SIRIDB_SCHEMA 3
#define SIRIDB_FLAG_REINDEXING 1
#define DEF_DROP_THRESHOLD 1.0 // 100%
}
/* check schema */
- if (qp_schema.via.int64 == 1)
+ if (qp_schema.via.int64 == 1 || qp_schema.via.int64 == 2)
{
log_info(
"Found an old database schema (v%d), "
#define SHARD_GROW_SZ 131072
/* shard schema (schemas below 20 are reserved for Python SiriDB) */
-#define SIRIDB_SHARD_SHEMA 20
+#define SIRIDB_SHARD_SHEMA 21
/*
* Header schema layout
return -1;
}
+ uint8_t schema = (uint8_t) header[HEADER_SCHEMA];
+ if (schema > SIRIDB_SHARD_SHEMA)
+ {
+ fclose(fp);
+ log_critical(
+ "Shard file '%s' has schema '%u' which is not supported with "
+ "this version of SiriDB.", shard->fn, schema);
+ siridb_shard_decref(shard);
+ return -1;
+ }
+
/* set shard type, flags and max_chunk_sz */
shard->tp = (uint8_t) header[HEADER_TP];
shard->flags = (uint8_t) header[HEADER_FLAGS] | SIRIDB_SHARD_IS_LOADING;